home *** CD-ROM | disk | FTP | other *** search
- /*
- File: MacFramework.h
-
- Contains: Basic Macintosh Functions for window, menu handling and similar things for the
- SG/vdig environment.
-
- Written by: DTS
-
- Copyright: © 1994-1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 4/25/95 khs first file
-
- */
-
-
- #pragma once
-
-
- // INCLUDES
- #include <Movies.h>
- #include <QuickTimeComponents.h>
- #include <TextUtils.h>
- #include <Memory.h>
-
- #include <stdio.h>
-
- #ifdef __MWERKS__
- #include <sioux.h>
- #endif // __MWERKS__
-
-
- // ENUMS, DEFINES AND GLOBALS
- enum { kMovieControllerObject = 'MCOb'
- };
-
-
-
- // ENUMS
- // MENUS
- enum eMenubar { mMenubar = 128};
-
- enum eMainMenus {
- mApple = 128, mFile, mEdit
- };
-
- enum eAppleMenu {
- iAbout = 1
- };
-
- enum eFileMenu{
- iNew = 1, iClose, iQuit = 4
- };
-
- enum eEditMenu {
- iUndo = 1, iCut = 3, iCopy, iPaste, iClear, iSelectAll = 8
- };
-
- // DIALOGS
- enum eDialogs {
- kAboutBox = 128, kAlertError = 129
- };
-
-
- // TYPEDEFS AND STRUCTURES
- // WindowObjectRecord/Ptr is a data structure attached to the movie window. Use
- // this structure if you want to associate any data with any window presented.
-
- typedef struct {
- OSType ObjectType; // specific tag indicating that the window object belongs to our application
- MovieController controller;
- Rect originalSize; // including movie controller
- FSSpec FileFSSpec;
- short FileResID;
- short FileRefNum;
-
- // add more elements if needed
- } WindowObjectRecord, *WindowObjectPtr, **WindowObject;
-
- // SG specific data structures
-
- typedef struct {
- SeqGrabComponent sg;
- SGChannel videoChannel;
- SGChannel soundChannel;
- WindowPtr sgWindow;
- } SGResourceRecord, *SGResourcePtr, **SGResourceHndl;
-
-
- // FUNCTION PROTOTYPES
-
- // PURE MAC TOOLBOX FUNCTIONS
- void InitStack(long extraStackSpace);
- void InitMacEnvironment(long nMoreMasters);
-
- Boolean InitMenubar(void);
- void HandleMenuCommand(long theMenuResult);
- void AdjustMenus(void);
- void MainEventLoop(void);
-
- Boolean IsAppWindow(WindowRef theWindow);
- WindowObject CreateWindowObject(WindowRef theWindow);
-
- void HandleKeyPress(EventRecord *theEvent);
- void ShowAboutDialogBox(void);
- void ShowWarning(Str255 theMessage, OSErr theErr);
-
- void DoDestroyMovieWindow(WindowRef theWindow);
- void DoActivateWindow(WindowRef theWindow, Boolean becomingActive);
-
-
- // APPLICATION SPECIFIC FUNCTIONS
- // These are placed in the MacApplication.c file, you could override these for changing
- // the behavior of the function in a specific application.
-
- void DoIdle(WindowRef theWindow);
- void DoUpdateWindow(WindowRef theWindow, Rect *theRefrehArea);
- void DoCloseWindow(WindowRef theWindow);
- void DoDragWindow(WindowRef theWindow, EventRecord *theEvent);
- void HandleContentClick(WindowRef theWindow, EventRecord *theEvent);
- WindowRef CreateMovieWindow(Rect *theRect, Str255 theTitle);
- void HandleApplicationMenu(short theMenuID, short theMenuItem);
- void AdjustApplicationMenus(void);
-
- // These are very specific sequence grabber and vdig functions used from the actual
- // application level.
- void CreateSGEnviroment(void);
- SeqGrabComponent GetDefaultSGInstance(void);
- SGChannel GetDefaultVideoChannel(void);
- SGChannel GetDefaultAudioChannel(void);
-
- pascal ComponentResult SpecialGrabFrameComplete(SGChannel c, short bufferNum,
- Boolean *done, long refCon);
- OSErr SetupVideoBottleNecks(SGChannel videoChannel, WindowPtr theWindow, CGrafPtr tempPort);
-
-